# 测试图片压缩
from PIL import Image, ImageFilter
import matplotlib.pyplot as plt
img = Image.open("./img/8P Even/IMG_2844_00.jpg")
# im_sz=(img.size[0]//8, img.size[1]//8)#这里size返回的是宽高而不是像素点多少
# img = img.resize(im_sz)
# img.save("00_-8.jpg")
# 应用高斯模糊滤镜
img_blurred = img.filter(ImageFilter.GaussianBlur(20))
# # img_blurred.save("00.jpg", "JPEG", quality=50)
img_blurred.save("00_gauss20.jpg")
img_blurred.save("00_jepg_g_20.jpg", "JPEG", quality=40)
# img.save("00_jepg1.jpg", "JPEG", quality=50)

# plt.imshow(img_blurred)